using System;

namespace Lari.Framework.Exceptions
{
    [Serializable]
    public sealed class LariException : ApplicationException
    {
        //public int Id
        //{
        //    get; private set;
        //}
        //public string CustomMessage
        //{
        //    get; private set;
        //}
        public bool IsLogRequired
        {
            get; private set;
        }

        //private static IMessageProvider MessageProvider
        //{
        //    get;
        //    set;
        //}

        //static LariException()
        //{
        //    try
        //    {
        //        new XmlMessageProvider();
        //    }
        //    catch (Exception ex)
        //    {
        //        throw new Exception("Message Provider not found. Configure it in the config file.", ex);
        //    }
        //}


        //public LariException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext ctx, int id, string customMessage, bool isLogRequired)
        //    : base(info, ctx)
        //{
        //    IsLogRequired = isLogRequired;
        //    CustomMessage = customMessage;
        //    Id = id;
        //}
        public LariException(string customMessage, bool isLogRequired=false)
            : base(customMessage)
        {
            IsLogRequired = isLogRequired;
            //CustomMessage = customMessage;
            //Id = id;
        }
        //public LariException(int id)
        //    : base(null, null)
        //{
        //    IsLogRequired = false;
        //    CustomMessage = "";
        //    Id = id;
        //}



        //public override string ToString()
        //{
        //    return string.Format("[{0}] - {1}", Id, CustomMessage);        
        //}
    }

}
